package com.cn.demo4.thread.setname1;

/**
 * @author Administrator
 * 设置线程的名称
 *    2)设置方法
 *
 */
public class MyThread extends Thread{
    @Override
    public void run(){
        for (int i = 1; i <= 10; i++) {
            System.out.println("线程" + getName() + "开启：执行第" + i + "次");
        }
    }
}
